﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace orienta.ViewModels
{
    public class Solicitud
    {
        public Solicitud() {
            this.referencias = new List<SolicitudReferencia>();
            this.nPlazo = 30;
        }


        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [DataType(DataType.Date, ErrorMessage = "Please enter a valid date (ex: 2/14/2011)")]
        [RegularExpression(@"^\d{1,2}\/\d{1,2}\/\d{4}$", ErrorMessage = "{0} no tiene una fecha valida")]
        [Display(Name = "Fecha de solicitud")]
        public String dtFecSolicitud { get; set; }

        [Range(0, 24, ErrorMessage = "La {0} debe estar entre 0 y 24")]
        [Display(Name = "Hora")]
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public String hora { get; set; }

        [Range(0, 60, ErrorMessage = "Los {0} deben estar entre 0 y 60")]
        [Display(Name = "Minutos")]
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public String minuto { get; set; }

        [Display(Name = "Modalidad")]
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public int nIdeTipoModa { get; set; }

        [Display(Name = "Idioma")]
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public int nIdeIdioma { get; set; }

        [Display(Name = "Pais del Sol.")]
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public int nIdiPaisSolic { get; set; }
        
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public int nIdiTipoDocSolic { get; set; }
        
        public String nNumDocSolic { get; set; }

        [Display(Name = "Pais del Sol.")]
        public String paisSol { get; set; }

        [Display(Name = "Pais del Afect.")]
        public String paisAfect { get; set; }

        public String nApePatSolic { get; set; }
        public String nApeMatSolic { get; set; }
        public String nNombreSolic { get; set; }

        [Display(Name = "Tipo de Solicitante")]
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public int nTipoSolicitante { get; set; }

        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public int nIdiTipoDocAfect { get; set; }
        
        [Display(Name = "Pais del Afect.")]
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public int nIdiPaisAfect { get; set; }
        
        public String nNumDocAfect { get; set; }

        //[Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Ap. Pat. Afectado")]
        public String nApePatAfect { get; set; }

        //[Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Ap. Mat. Afectado")]
        public String nApeMatAfect { get; set; }

        //[Required(ErrorMessage = "El campo {0} es obligatorio.")]
        //[Display(Name = "Nombre Afectado")]
        public String nNombreAfect { get; set; }


        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public int nIdeTipoDiscap { get; set; }


        [Display(Name = "Clase de solicitud")]
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public int nIdClaseSolicitud { get; set; }

        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Tipo de solicitud")]
        public int nIdTipoSolicitud { get; set; }
        //public String sTipoSolicitud { get; set; }

       // [Required(AllowEmptyStrings = true)]
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Programa")]
        //[Required(
        public int nIdePrograma { get; set; }

        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Solicitante")]
        public decimal? nIdeSolic { get; set; }

        public String nombreSolic { get; set; }
        public String primApellidoSolic { get; set; }
        public String segueSolic { get; set; }
        
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Afectado")]
        public decimal? nIdeAfect { get; set; }

        public int nIdeSolicitud { get; set; }

        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Sumilla")]
        [RegularExpression(@"^[0-9.,-_'#:a-zA-Z_ÁÉÍÓÚáéíóúñ\s]*$", ErrorMessage = "El campo {0} tiene caracteres no validos")]
        public String sSumilla { get; set; }

        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Accion")]
        [RegularExpression(@"^[0-9.,-_'#:a-zA-Z_ÁÉÍÓÚáéíóúñ\s]*$", ErrorMessage = "El campo {0} tiene caracteres no validos")]
        public String sAccion { get; set; }

        [Display(Name = "Para")]
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public int nIdePara { get; set; }

        [Display(Name = "Medio")]
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public int nIdeMedio { get; set; }

        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        public int nIdePrioridad { get; set; }


        /*Doc entrante*/

        public int nIdeTipoDocEntrante { get; set; }

        /*[Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Tipo de documento entrante")]*/
        public String sTipoDocEntrante { get; set; }

        /*
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Numero de documento entrante")]
        */
        public String sNroDocEntrante { get; set; }

        /*[Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [DataType(DataType.Date, ErrorMessage = "Please enter a valid date (ex: 2/14/2011)")]
        [RegularExpression(@"^\d{1,2}\/\d{1,2}\/\d{4}$", ErrorMessage = "{0} no tiene una fecha valida")]
        [Display(Name = "Fecha de doc. entrante")]*/
        public String dtFecDocEntrante { get; set; }

        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Plazo")]
        public int nPlazo { get; set; }

        public int nIdePeriodo { get; set; }

        public int nFolios { get; set; }

        public String sConfidencial { get; set; }


        public List<SolicitudReferencia> referencias { get; set; }

        /*
        [Required(ErrorMessage = "El campo {0} es obligatorio.")]*/
        [Display(Name = "Derivar")]
        [RegularExpression(@"^[0-9,--.<>a-zA-Z_áéíóúñ\s]*$", ErrorMessage = "El campo {0} tiene caracteres no validos")]
        public String sDerivar { get; set; }

        [Display(Name = "Derivar con Copia")]
        [RegularExpression(@"^[0-9,--.<>a-zA-Z_áéíóúñ\s]*$", ErrorMessage = "El campo {0} tiene caracteres no validos")]
        public String sDerivarCC { get; set; }



        /*Tipo de documento*/
        /*
        public int nIdeTipoDocReferencia{ get; set; }

        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Tipo de documento referencia")]
        public String sTipoDocReferencia { get; set; }

        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [Display(Name = "Numero de documento referencia")]
        public String sNroDocReferencia { get; set; }

        [Required(ErrorMessage = "El campo {0} es obligatorio.")]
        [DataType(DataType.Date, ErrorMessage = "Please enter a valid date (ex: 2/14/2011)")]
        [RegularExpression(@"^\d{1,2}\/\d{1,2}\/\d{4}$", ErrorMessage = "{0} no tiene una fecha valida")]
        [Display(Name = "Fecha de doc. referencia")]
        public String dtFecDocReferencia{ get; set; }

        public String sComentario { get; set; }
        */




        
    }
}